package com.movie2.controller;

import com.alibaba.fastjson.JSON;
import com.movie2.model.entity.Test;
import com.movie2.model.vo.Test11Vo;
import com.movie2.service.Test11Service;
import com.movie2.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:
 *
 * @author 项浩楠
 * @since 14:12 2022/10/11
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
    @Autowired
    private TestService testService;
    @Autowired
    private Test11Service test11Service;
    
    @GetMapping("/test04")
    public List<Test> test04(@RequestParam Integer colId){
        List<Test> testList=testService.getTestList(colId);
        log.info("testList1:{}", JSON.toJSONString(testList));
        log.info("testList2:{}",testList);
        return testList;
    }
    
    @GetMapping("/test11")
    public Test11Vo test11(){
        Test11Vo vo=test11Service.test();
        log.info("vo:{}",vo);
        return vo;
    }
}
